#ifndef MIS_COMMAND_H_
#define MIS_COMMAND_H_

#include "command.h"

#ifdef _WIN32
#pragma warning( push )
#pragma warning( disable : 4200 )
#endif

#pragma pack(1)
namespace Cmd
{
        enum //CMD_MIS
        {
                SCMD_MIS_NULL                   = 0x0000,
                SCMD_MIS_LIST_REQ               = 0x0001,
                SCMD_MIS_LIST_RES               = 0x0002,
        };
        struct stMisListReq:
                t_NullCmd
        {
                stMisListReq():
                        t_NullCmd(CMD_MIS, SCMD_MIS_LIST_REQ)
                {
                }
        };
        struct stMisListRes:
                t_NullCmd
        {
                stMisListRes():
                        t_NullCmd(CMD_MIS, SCMD_MIS_LIST_RES)
                {
                        finish_ = 0;
                        len_ = 0;
                }
                DWORD getSize() 
                {
                        return sizeof(*this)+len_*sizeof(list_[0]);
                }
                void setListStr(const std::string &str) 
                {
                        strncpy(list_, str.c_str(), str.size());
                }
                BYTE finish_;   //0-no, 1-yes
                WORD len_;  // Json长度
                char list_[0];  //Json格式
                /*
                 * {
                 *      "departments":
                 *      [
                 *              {"name":"技术中心","id":"1"},
                 *              {"name":"编辑部","id":"2"},
                 *              ...
                 *      ],
                 *      "members":
                 *      [
                 *              {"id":"123","name":"张三","acc":"zhangsan","nick":"小三","mail":"san@hujiang.com","dep":"1"},
                 *              {"id":"456","name":"李四","acc":"lisi","nick":"小四","mail":"si@hujiang.com","dep":"2"},
                 *              ...
                 *      ]
                 * }
                 * */
        };
};//namespace Cmd
#pragma pack()

#ifdef _WIN32
#pragma warning( pop )
#endif

#endif //MIS_COMMAND_H_
